<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="h" uri="/syzg-html"%>
<!DOCTYPE html>
<html>
<body>
	<div class="modal fade bs-example-modal-lg" id="addModal" tabindex="-1"
		role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">新增信息</h4>
				</div>
				<div class="modal-body" id="modalCore">
					<form class="form-horizontal" role="form" id="aeForm" name="aeForm">
						<fieldset>
							<!-- generate code start -->
							<input type="hidden" id="id" name="id" value="${newscolumns.id}"/>
							<input type="hidden" id="parentId" name="parentId" value="${newscolumns.parentId}" class="form-control" />
							<!-- 
							<div class="form-group">
								<label class="col-sm-2 control-label" for="id">ID</label>
								<div class="col-sm-3">
									<input type="hidden" id="id" name="id" value="${newscolumns.id}"
										class="form-control" readonly="readonly" />
								</div>

								<label class="col-sm-2 control-label" for="parentId">父ID</label>
								<div class="col-sm-3">
									<input type="hidden" id="parentId" name="parentId" value="${newscolumns.parentId}" class="form-control" />
								</div>
							</div>
 							-->
							<div class="form-group">
								<label class="col-sm-2 control-label" for="name">名称</label>
								<div class="col-sm-3">
									<input type="text" id="name" name="name"
										value="${newscolumns.name}" class="form-control" />
								</div>

								<label class="col-sm-2 control-label" for="orderNo">序号</label>
								<div class="col-sm-3">
									<input type="text" id="orderNo" name="orderNo"
										value="${newscolumns.orderNo}" class="form-control" />
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-2 control-label" for="remark">备注</label>
								<div class="col-sm-8">
									<textarea id="remark" name="remark" class="form-control">${newscolumns.remark}</textarea>
									<input type="hidden" id="url" name="url" value="#" class="form-control" />
										
								</div>
								<!-- 
								<label class="col-sm-2 control-label" for="url">链接</label>
								<div class="col-sm-3">
								</div>
								 -->
							</div>
							<!-- 
							<div class="form-group">
								<input type="hidden" id="isThisWebsite" name="isThisWebsite" value="1"/>
								<label class="col-sm-2 control-label" for="isThisWebsite">是否本网站</label>
								<div class="col-sm-3">
									<input type="radio" id="isThisWebsite_yes" name="isThisWebsite"
										value="1"
										<c:if test="${basicdata.isThisWebsite=='1'}">checked="checked"</c:if> />是&nbsp;&nbsp;
									<input type="radio" id="isThisWebsite_no" name="isThisWebsite"
										value="0"
										<c:if test="${basicdata.isThisWebsite=='0'}">checked="checked"</c:if> />否
								</div>
 								
								<label class="col-sm-2 control-label" for="coverPath">封面图片</label>
								<div class="col-sm-3">
									<div style="border: 1px #000 solid;width: 100px;height: 100px;cursor: hand;">
										<img src="${newscolumns.coverPath}" style="width: 100px;height: 100px;" alt="选择图片" onclick="doSelectPic()">
									</div>
									<input type="hidden" id="coverPath" name="coverPath"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="content">新闻描述</label>
								<div class="col-sm-3">
									<textarea id="content" name="content" class="form-control"
										cols="250" style="width:570px;">${newscolumns.content}</textarea>
								</div>
							</div>
							 -->
							<!-- generate code end -->
						</fieldset>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary"
						onclick="submitSave('add');">保存</button>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$('#aeForm').bootstrapValidator({
			message : 'This value is not valid',
			feedbackIcons : {
				valid : 'glyphicon glyphicon-ok',
				invalid : 'glyphicon glyphicon-remove',
				validating : 'glyphicon glyphicon-refresh'
			},
			fields : {
				name : {
					group : '.col-sm-3',
					message : 'The username is not valid',
					validators : {
						notEmpty : {
							message : '名称不允许为空'
						},
						stringLength : {
							min : 2,
							max : 30,
							message : '名称的长度必须在2-30个字符之间'
						}
					}
				},
				email : {
					group : '.col-sm-3',
					validators : {
						emailAddress : {
							message : 'The input is not a valid email address'
						}
					}
				}
			}
		}).on('success.form.bv', function(e, data) {
			FormFunction.submitSave('add');
		});
	</script>
</body>
</html>